package com.lfs.aspects;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;

@JsonInclude(Include.NON_NULL)
public class ResponseEntity<T> {

    /**
     * state ：状态 date : 数据
     */
    private Integer state;

    private String description;

    private T data;

    public Integer getState() {
        return state;
    }

    public ResponseEntity<T> setState(Integer state) {
        this.state = state;
        return this;
    }

    public T getData() {
        return data;
    }

    public ResponseEntity<T> setData(T data) {
        this.data = data;
        return this;
    }

    public String getDescription() {
        return description;
    }

    public ResponseEntity<T> setDescription(String description) {
        this.description = description;
        return this;
    }

    @JsonIgnore
    public ResponseEntity<T> setBusinessType(BusinessType businessType) {
        this.state = businessType.state;
        this.description = businessType.description;
        return this;
    }
}
